﻿@using LETS.Helpers
@using Orchard.Security
@using Orchard.Utility.Extensions
@{
    Script.Require("jQuery");
    //Script.Include("base.js").AtFoot();
    Script.Require("ShapesBase").AtFoot();
}
@Html.AntiForgeryTokenOrchard()

@if(WorkContext.Resolve<IAuthorizationService>().TryCheckAccess(Orchard.Core.Contents.Permissions.EditContent, WorkContext.CurrentUser, Model.ContentItem))
{
    @Html.ActionLink(T("Edit").ToString(), "Edit", "Notice", new { area = "LETS", id = Model.ContentItem.Id }, new { @class = "edit" }) @:|
    @Html.ActionLink(T("Delete").ToString(), "Delete", "Notice", new { area = "LETS", id = Model.ContentItem.Id }, new { @class = "edit", itemprop = "UnsafeUrl RemoveUrl" }) @:|
    var published = Helpers.IsPublished(Model.ContentItem);
    if (published)
    {
        @*@Html.ActionLink(T("Archive").ToString(), "Archive", "Notice", new { area = "LETS", id = Model.ContentItem.Id }, new { @class = "edit", itemprop = "UnsafeUrl" })*@
        @*@Html.ActionLink(T("Archive").ToString(), "Archive", "Notice", new { area = "LETS", id = Model.ContentItem.Id }, new { @class = "edit", itemprop = "UnsafeUrl" })*@
        @Html.Link(T("Archive").Text, Url.Action("Unpublish", "Notice", new { area = "LETS", id = Model.ContentItem.Id }), new { @class = "edit", itemprop = "UnsafeUrl ArchiveUrl" })
    }
    else
    {
        @Html.ActionLink(T("Publish").ToString(), "Publish", "Notice", new { area = "LETS", id = Model.ContentItem.Id }, new { @class = "edit", itemprop = "UnsafeUrl" })
    }
}
